package com.jzo2o.customer.controller.consumer;

import com.jzo2o.customer.model.dto.request.AddressBookUpsertReqDTO;
import com.jzo2o.customer.service.IAddressBookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @BelongsProject: jzo2o-customer
 * @BelongsPackage: com.jzo2o.customer.controller.consumer
 * @Author: songYuHang
 * @CreateTime: 2025-03-21  20:38
 * @Description: TODO
 * @Version: 1.0
 */
@RestController("ConsumerController")
@RequestMapping("/consumer")
@Api(tags = "用户端 - 我的地址相关")
public class ConsumerController {

    @Resource
    private IAddressBookService addressBookService;

    @PostMapping("/address-book")
    @ApiOperation("添加用户我的地址")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneCode", value = "微信手机号授权码", required = true, dataTypeClass = String.class)
    })
    public void addAddressBook(@RequestBody @Validated AddressBookUpsertReqDTO addressBookUpsertReqDTO) {

        addressBookService.addAddressBook(addressBookUpsertReqDTO);

    }

}
